class TagEntity {
  TagEntity({
    this.id,
    this.count,
    this.name,
  });

  String? id;
  String? count; // Dart中没有Long，所以使用int代替
  String? name;

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'count': count,
      'name': name,
    };
  }

  factory TagEntity.fromJson(Map<String, dynamic> json) {
    return TagEntity(
      id: json['id'] as String?,
      count: json['count'] as String?,
      name: json['name'] as String?,
    );
  }
}

class TagEntityList {
  TagEntityList({
    this.tagEntities,
  });

  List<TagEntity>? tagEntities;

  Map<String, dynamic> toJson() {
    return {'tagEntities': tagEntities?.map((v) => v.toJson()).toList()};
  }

  factory TagEntityList.fromJson(Map<String, dynamic> json) {
    if (json['tagEntities'] != null) {
      List<TagEntity> tagEntitiesList = json['tagEntities'].map<TagEntity>((v) => TagEntity.fromJson(v)).toList();
      return TagEntityList(
        tagEntities: tagEntitiesList,
      );
    } else {
      return TagEntityList();
    }
  }
}
